<template>
    <div>
        <h3>add当前最新count值为：{{$store.state.count}}</h3>
        <h3>{{$store.getters.showNum}}</h3>
        <button @click="addcount">+1</button>
        <button @click="addcountN">+N</button>
        <button @click="addcountAsync">+1 Async</button>
        <button @click="addcountAsyncN">+N Async</button>
    </div>
</template>

<script>
export default {
  data () {
    return {}
  },
  methods: {
    addcount () {
      this.$store.commit('add')
    },
    addcountN () {
      this.$store.commit('addN', 3)
    },
    addcountAsync () {
      this.$store.dispatch('addcountAsync')
    },
    addcountAsyncN () {
      this.$store.dispatch('addcountAsyncN', 5)
    }
  }
}
</script>
